package com.huawei.appmarket.service.appdetail.view.card;

import android.app.Activity;
import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.os.Bundle;
import android.os.Handler;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.FrameLayout.LayoutParams;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RatingBar;
import android.widget.TextView;
import com.huawei.appgallery.forum.base.card.bean.Section;
import com.huawei.appgallery.foundation.ui.css.CSSDeclaration;
import com.huawei.appgallery.foundation.ui.css.adapter.CSSPropertyName;
import com.huawei.appgallery.foundation.ui.css.adapter.type.CSSImage;
import com.huawei.appgallery.foundation.ui.framework.widget.MultiLineLabelLayout;
import com.huawei.appgallery.jsonkit.api.JsonBean;
import com.huawei.appmarket.framework.widget.ArrowImageView;
import com.huawei.appmarket.framework.widget.CustomActionBar;
import com.huawei.appmarket.framework.widget.RenderImageView;
import com.huawei.appmarket.framework.widget.RenderImageView.b;
import com.huawei.appmarket.service.appdetail.bean.detail.DetailHeadBean;
import com.huawei.appmarket.service.appdetail.bean.detail.DetailHeadBean.AppInfoLabel;
import com.huawei.appmarket.service.appdetail.bean.detail.DetailHeadBean.Label;
import com.huawei.appmarket.service.appdetail.view.widget.DetailFollowSectionButton;
import com.huawei.secure.android.common.intent.SafeIntent;
import java.util.List;
import o.azb;
import o.bqy;
import o.brd;
import o.bus;
import o.bwx;
import o.bwz;
import o.AccountBussinessListener;
import o.ccp;
import o.ccq;
import o.cdn;
import o.cjz;
import o.ckt;
import o.dgm;
import o.Logger;
import o.dof;
import o.ContentManager;
import o.drl;
import o.drn;
import o.drq;
import o.egu;
import o.egu.a;
import o.eib;
import o.epv;
import o.CollectCheck;
import o.eqp;
import o.eqx;
import o.eqz;
import o.erq;
import o.ewm.c;
import o.ewm.d;
import o.ewm.h;
import o.ewm.j;
import o.ewm.n;
import o.fho;
import o.fis;
import o.fjo;
import o.fjq;

public class DetailHeadCard extends drl implements OnClickListener, b, eqz, drn, AccountBussinessListener {
    private boolean ʻ;
    private ViewGroup ʻॱ;
    private TextView ʼ;
    private LinearLayout ʼॱ;
    private boolean ʽ;
    private RenderImageView ʽॱ;
    private boolean ʾ;
    private View ʿ;
    private LayoutInflater ˈ;
    private ImageView ˉ;
    private LinearLayout ˊˊ;
    private TextView ˊˋ;
    private RatingBar ˊॱ;
    private ImageView ˊᐝ;
    private LinearLayout ˋˊ;
    private View ˋˋ;
    private MultiLineLabelLayout ˋॱ;
    private TextView ˋᐝ;
    private TextView ˌ;
    private ImageView ˍ;
    private TextView ˎˎ;
    private View ˎˏ;
    private View ˏˎ;
    private TextView ˏˏ;
    private TextView ˏॱ;
    private View ˑ;
    private View ͺ;
    private DetailFollowSectionButton ͺॱ;
    private boolean ـ;
    private DetailFollowSectionButton ॱʻ;
    private DetailHeadBean ॱʽ;
    private TextView ॱˊ;
    private View ॱˋ;
    private ArrowImageView ॱˎ;
    private String ॱͺ;
    private ImageView ॱॱ;
    private ViewGroup ॱᐝ;
    private View ᐝॱ;

    public DetailHeadCard() {
        this.ʽ = false;
        this.ʻ = false;
        this.ʾ = false;
        this.ॱ = 300;
    }

    public View ˊ(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
        this.ˈ = layoutInflater;
        this.ˊ = layoutInflater.inflate(h.ˈ, null);
        azb.ˏ(this.ˊ, j.ॱᵎ);
        this.ॱॱ = (ImageView) this.ˊ.findViewById(j.ۥ);
        this.ʿ = this.ˊ.findViewById(j.ᐪ);
        this.ˋˊ = (LinearLayout) this.ˊ.findViewById(j.ᐝˈ);
        this.ˊˊ = (LinearLayout) this.ˊ.findViewById(j.ᐝˌ);
        this.ˊˋ = (TextView) this.ˊ.findViewById(j.ᐝᐧ);
        this.ˎˎ = (TextView) this.ˊ.findViewById(j.ᐝـ);
        this.ˌ = (TextView) this.ˊ.findViewById(j.ᐝˉ);
        this.ʼॱ = (LinearLayout) this.ˊ.findViewById(j.ᐝᶥ);
        this.ʼ = (TextView) this.ˊ.findViewById(j.ٴॱ);
        this.ˊॱ = (RatingBar) this.ˊ.findViewById(j.ॱٴ);
        this.ॱˊ = (TextView) this.ˊ.findViewById(j.ॱߴ);
        this.ˏॱ = (TextView) this.ˊ.findViewById(j.ॱՙ);
        this.ͺ = this.ˊ.findViewById(j.ॱߺ);
        this.ˋॱ = (MultiLineLabelLayout) this.ˊ.findViewById(j.ॱי);
        this.ᐝॱ = this.ˊ.findViewById(j.ॱᶫ);
        this.ʻॱ = (ViewGroup) this.ˊ.findViewById(j.ॱᴵ);
        azb.ˏ(this.ʻॱ);
        this.ॱˋ = this.ˊ.findViewById(j.ॱⁱ);
        this.ॱᐝ = (ViewGroup) this.ˊ.findViewById(j.ॱﹶ);
        this.ˏˎ = this.ˊ.findViewById(j.ᐧʼ);
        azb.ˏ(this.ʻॱ);
        azb.ˏ(this.ॱᐝ);
        cjz.ˎ(this.ʼ);
        this.ʽॱ = (RenderImageView) this.ˊ.findViewById(j.ˉʼ);
        if (cdn.ॱॱ()) {
            this.ʽॱ.setTag(ContentManager.getInstant().getContext().getResources().getString(n.ᵢ));
        }
        this.ˉ = (ImageView) this.ˊ.findViewById(j.ՙॱ);
        this.ˊᐝ = (ImageView) this.ˊ.findViewById(j.ˈ);
        this.ʽॱ.setListener(this);
        this.ˍ = (ImageView) this.ˊ.findViewById(j.ᐝⁱ);
        this.ˋᐝ = (TextView) this.ˊ.findViewById(j.ᐝᵔ);
        this.ˋˋ = this.ˊ.findViewById(j.ʽՙ);
        this.ˋˋ.setOnClickListener(new ckt(this));
        this.ˎˏ = this.ˊ.findViewById(j.ᐝٴ);
        azb.ˏ(this.ˎˏ);
        this.ˏˏ = (TextView) this.ˊ.findViewById(j.ߴॱ);
        this.ˑ = this.ˊ.findViewById(j.ॱʹ);
        this.ͺॱ = (DetailFollowSectionButton) this.ˊ.findViewById(j.ˬ);
        this.ͺॱ.setOnClickListener(new ckt(this));
        this.ॱʻ = (DetailFollowSectionButton) this.ˊ.findViewById(j.ᐝꜞ);
        this.ॱʻ.setOnClickListener(new ckt(this));
        ˊॱ();
        return this.ˊ;
    }

    private DetailFollowSectionButton ʻ() {
        return this.ʽ ? this.ॱʻ : this.ͺॱ;
    }

    public boolean ˊ(List<JsonBean> list) {
        if (list == null || list.size() <= 0 || this.ʼ == null) {
            return false;
        }
        this.ॱʽ = (DetailHeadBean) list.get(0);
        if (this.ॱʽ == null || TextUtils.isEmpty(this.ॱʽ.v_())) {
            return false;
        }
        this.ʽ = this.ॱʽ.ˊॱ() == 15;
        ˏ(this.ॱʽ);
        ˎ(this.ॱʽ.ॱˎ());
        if (this.ʽ) {
            this.ˊˊ.setVisibility(8);
            this.ˋˊ.setVisibility(8);
            this.ᐝॱ.setVisibility(8);
            this.ˎˏ.setVisibility(8);
            this.ʼॱ.setVisibility(0);
            this.ˏˎ.setVisibility(8);
            this.ॱˋ.setVisibility(0);
            ᐝ();
        } else {
            this.ˋˊ.setVisibility(0);
            this.ʼॱ.setVisibility(8);
            this.ॱˋ.setVisibility(8);
            this.ˏˎ.setVisibility(0);
            ˏॱ();
        }
        return true;
    }

    private void ᐝ() {
        ((TextView) this.ʼॱ.findViewById(j.ᐝꓸ)).setText(this.ॱʽ.v_());
        ((TextView) this.ʼॱ.findViewById(j.ᐝꜟ)).setText(this.ॱʽ.O_());
        ((TextView) this.ʼॱ.findViewById(j.ᐝﹳ)).setText(this.ॱʽ.ʼॱ());
        ॱ(this.ॱʽ);
    }

    private void ॱ(DetailHeadBean detailHeadBean) {
        if (this.ॱˋ != null && this.ॱᐝ != null) {
            if (detailHeadBean == null) {
                Logger.ˎ("DetailHeadCard", "headBean == null");
                return;
            }
            List ʾ = detailHeadBean.ʾ();
            if (CollectCheck.isEmpty(ʾ) || ʾ.size() < 3) {
                Logger.ˎ("DetailHeadCard", "invalid game test info list");
                return;
            }
            View inflate;
            if (epv.ʼ(this.ॱˋ.getContext())) {
                inflate = this.ˈ.inflate(h.ʼॱ, null);
            } else {
                inflate = this.ˈ.inflate(h.ʿ, null);
            }
            TextView textView = (TextView) inflate.findViewById(j.ˉʿ);
            TextView textView2 = (TextView) inflate.findViewById(j.ˉᐨ);
            ((TextView) inflate.findViewById(j.ˉˉ)).setText((CharSequence) ʾ.get(0));
            textView.setText((CharSequence) ʾ.get(1));
            textView2.setText((CharSequence) ʾ.get(2));
            this.ॱᐝ.addView(inflate);
        }
    }

    private void ˏॱ() {
        ˎ(this.ॱʽ);
        this.ʼ.setText(this.ॱʽ.v_());
        ˋ(this.ॱʽ);
        if (this.ˊॱ != null) {
            this.ˊॱ.setRating(this.ॱʽ.ʽ());
        }
        if (ʼ(this.ॱʽ)) {
            this.ͺ.setVisibility(0);
        } else {
            this.ͺ.setVisibility(8);
        }
        if (ˋॱ()) {
            this.ˊˊ.setVisibility(0);
            this.ˋˊ.setVisibility(8);
            ˊ(this.ॱʽ);
        }
        ᐝ(this.ॱʽ);
        ॱॱ(this.ॱʽ);
        this.ॱͺ = this.ॱʽ.ˊ();
    }

    private boolean ˋॱ() {
        return this.ʻ;
    }

    public void ˋ(boolean z) {
        this.ʻ = z;
    }

    private void ˊ(DetailHeadBean detailHeadBean) {
        if (!TextUtils.isEmpty(detailHeadBean.v_())) {
            this.ˊˋ.setText(detailHeadBean.v_());
        }
        if (!TextUtils.isEmpty(detailHeadBean.O_())) {
            this.ˎˎ.setText(detailHeadBean.O_());
        }
        if (!TextUtils.isEmpty(detailHeadBean.ʼ())) {
            this.ˌ.setText(detailHeadBean.ʼ());
        }
    }

    private boolean ˎ(int i, boolean z) {
        if (this.ॱˊ == null) {
            return false;
        }
        if (i == 3) {
            Context ˋ = ContentManager.getInstant().getContext();
            if (z) {
                this.ॱˊ.setText(ˋ.getResources().getString(n.ˊᐨ));
            } else {
                this.ॱˊ.setText(ˋ.getResources().getString(n.ˊˑ));
            }
            this.ॱˊ.setVisibility(0);
            return true;
        }
        this.ॱˊ.setVisibility(8);
        return false;
    }

    private void ˋ(DetailHeadBean detailHeadBean) {
        if (this.ˏॱ == null) {
            return;
        }
        if (detailHeadBean.ˊॱ() == 1 || detailHeadBean.ˊॱ() == 3) {
            this.ˏॱ.setText(detailHeadBean.ͺ());
        } else {
            this.ˏॱ.setText(detailHeadBean.O_());
        }
    }

    private void ˏ(DetailHeadBean detailHeadBean) {
        if (this.ॱॱ == null) {
            return;
        }
        if (!TextUtils.isEmpty(detailHeadBean.ॱˑ())) {
            eqx.ॱ(this.ॱॱ, detailHeadBean.ॱˑ(), "app_default_icon");
        } else if (!TextUtils.isEmpty(detailHeadBean.ᐝ())) {
            eqx.ˏ(this.ॱॱ, detailHeadBean.ᐝ(), "app_default_icon");
        }
    }

    private void ˎ(DetailHeadBean detailHeadBean) {
        if (this.ˊᐝ == null) {
            return;
        }
        if (detailHeadBean.ॱˊ() == null || TextUtils.isEmpty(detailHeadBean.ॱˊ().ˋ())) {
            this.ˊᐝ.setVisibility(0);
            return;
        }
        this.ˊᐝ.setVisibility(0);
        eqx.ˏ(this.ˊᐝ, detailHeadBean.ॱˊ().ˋ(), "iconflag");
    }

    private void ॱॱ(DetailHeadBean detailHeadBean) {
        boolean z = true;
        if (TextUtils.isEmpty(detailHeadBean.ॱˋ())) {
            this.ˏˏ.setVisibility(8);
        } else {
            this.ˏˏ.setVisibility(0);
            this.ˏˏ.setText(detailHeadBean.ॱˋ());
        }
        if (TextUtils.isEmpty(detailHeadBean.ॱᐝ())) {
            this.ˉ.setVisibility(8);
        } else {
            this.ˉ.setVisibility(0);
            eqx.ˏ(this.ˉ, detailHeadBean.ॱᐝ(), "iconflag");
        }
        int ˊॱ = detailHeadBean.ˊॱ();
        if (1 != detailHeadBean.appType_) {
            z = false;
        }
        if (!ˎ(ˊॱ, z) && TextUtils.isEmpty(detailHeadBean.ॱˋ()) && TextUtils.isEmpty(detailHeadBean.ॱᐝ())) {
            this.ˑ.setVisibility(8);
        }
    }

    private boolean ʼ(DetailHeadBean detailHeadBean) {
        if (detailHeadBean == null || !detailHeadBean.ʻॱ()) {
            return false;
        }
        boolean ˏ = ˏ(detailHeadBean.ˋॱ());
        if (ˏ) {
            this.ͺ.setVisibility(0);
        }
        List ˏॱ = detailHeadBean.ˏॱ();
        if (CollectCheck.isEmpty(ˏॱ)) {
            return false;
        }
        int size = ˏॱ.size();
        for (int i = 0; i < size; i++) {
            View inflate;
            TextView textView;
            TextView textView2;
            if (i == size - 1) {
                inflate = this.ˈ.inflate(h.ˌ, null);
                textView2 = (TextView) inflate.findViewById(j.ꓸ);
                if (ˏ) {
                    this.ॱˎ = (ArrowImageView) inflate.findViewById(j.ॱߵ);
                    this.ॱˎ.setVisibility(0);
                    textView = textView2;
                }
                textView = textView2;
            } else {
                inflate = this.ˈ.inflate(h.ˎˎ, null);
                textView2 = (TextView) inflate.findViewById(j.ꓸ);
                textView = (TextView) inflate.findViewById(j.ᐧ);
                textView.setVisibility(0);
                if (detailHeadBean.ॱ()) {
                    textView.setVisibility(4);
                }
                textView = textView2;
            }
            inflate.setLayoutParams(ˏ(inflate));
            AppInfoLabel appInfoLabel = (AppInfoLabel) ˏॱ.get(i);
            if (appInfoLabel.ˎ() == 1) {
                int color = ContentManager.getInstant().getContext().getResources().getColor(c.ॱ);
                textView.setTextColor(color);
                textView.setTag(j.ﹺˎ, Integer.valueOf(color));
            }
            textView.setText(appInfoLabel.ˏ());
            this.ˋॱ.addView(inflate);
        }
        return true;
    }

    private LayoutParams ˏ(View view) {
        LayoutParams layoutParams = (LayoutParams) view.getLayoutParams();
        if (layoutParams == null) {
            return new LayoutParams(-2, -1);
        }
        return layoutParams;
    }

    private boolean ˏ(List<Label> list) {
        if (CollectCheck.isEmpty((List) list)) {
            return false;
        }
        for (int i = 0; i < list.size(); i++) {
            Label label = (Label) list.get(i);
            View inflate = this.ˈ.inflate(h.ͺॱ, null);
            eqx.ˎ((ImageView) inflate.findViewById(j.ۥ), label.ˊ());
            if (i == list.size() - 1) {
                ((ImageView) inflate.findViewById(j.ᐣ)).setVisibility(8);
            }
            ((TextView) inflate.findViewById(j.ᐝᐨ)).setText(label.ˎ());
            if (!(dof.ʽ(label.ॱ()) || dof.ʽ(label.ˏ()))) {
                TextView textView = (TextView) inflate.findViewById(j.ʹʽ);
                TextView textView2 = (TextView) inflate.findViewById(j.ʻʹ);
                textView.setText(label.ॱ());
                textView2.setText(label.ˏ());
                textView.setVisibility(0);
                textView2.setVisibility(0);
            }
            this.ʻॱ.addView(inflate);
        }
        this.ͺ.setOnClickListener(this);
        this.ᐝॱ.setVisibility(8);
        return true;
    }

    private void ˏ(Activity activity) {
        if ("com.huawei.appmarket".equals(activity.getPackageName())) {
            a aVar = new a();
            aVar.ˋ(dgm.ॱ(activity));
            aVar.ॱ(activity.getPackageName());
            egu.ˎ(activity, aVar);
            return;
        }
        Intent intent = new Intent();
        intent.setPackage("com.huawei.appmarket");
        intent.setAction("com.huawei.appmarket.intent.action.ACCESS_RESTRICTIONS");
        intent.putExtra("content_restrict_client_name", activity.getString(n.ˊᶥ));
        intent.putExtra("content_restrict_client_package", activity.getPackageName());
        try {
            activity.startActivityForResult(intent, 3000);
        } catch (ActivityNotFoundException e) {
            Logger.ˋ("DetailHeadCard", e.getMessage());
        }
    }

    public void onClick(View view) {
        if (view.getId() == j.ʽՙ) {
            ˏ((Activity) view.getContext());
        } else if (view.getId() == j.ˬ || view.getId() == j.ᐝꜞ) {
            ˋ((Activity) view.getContext());
        } else {
            drq.ॱ(this, null, 0);
            this.ʾ = !this.ʾ;
            if (this.ʾ) {
                this.ᐝॱ.setVisibility(0);
                this.ॱˎ.setArrowUp(true);
                return;
            }
            this.ᐝॱ.setVisibility(8);
            this.ॱˎ.setArrowUp(false);
        }
    }

    private void ˋ(Activity activity) {
        int i = 1;
        if (this.ॱʽ == null) {
            Logger.e("DetailHeadCard", "titleBean == null");
        } else if (activity == null || activity.isFinishing()) {
            Logger.e("DetailHeadCard", "invalid activity status");
        } else {
            if (1 != this.ॱʽ.ॱˎ()) {
                i = 0;
            }
            final String ˎ = ((bus) fho.ˏ().ˋ("Forum").ॱ(bus.class)).ˎ();
            bwx o_bwx = (bwx) fho.ˏ().ˋ("Operation").ॱ(bwx.class);
            final Section section = new Section();
            section.ॱ(this.ॱʽ.ᐝॱ());
            final Activity activity2 = activity;
            o_bwx.ˊ(activity, section, i, ˎ).ˏ(new fjq<Boolean>(this) {
                final /* synthetic */ DetailHeadCard ˏ;

                public void onComplete(fjo<Boolean> o_fjo_java_lang_Boolean) {
                    int i = 1;
                    if (o_fjo_java_lang_Boolean.ˊ() && ((Boolean) o_fjo_java_lang_Boolean.ॱ()).booleanValue()) {
                        if (i == 0) {
                            section.ˊ(1);
                            this.ˏ.ॱʽ.ˏ(1);
                            this.ˏ.ˎ(1);
                        } else {
                            section.ˊ(0);
                            this.ˏ.ॱʽ.ˏ(0);
                            this.ˏ.ˎ(0);
                        }
                        brd o_brd = brd.ॱ;
                        String str = ˎ;
                        int ˎ = bqy.ˋ().ˎ(activity2);
                        int ˊ = section.ˊ();
                        String str2 = "APPDETAIL";
                        if (i != 0) {
                            i = 0;
                        }
                        o_brd.ˊ(str, ˎ, ˊ, str2, i);
                    }
                }
            });
        }
    }

    private ViewGroup.LayoutParams ˏ(ImageView imageView) {
        ViewGroup.LayoutParams layoutParams = imageView.getLayoutParams();
        if (layoutParams == null) {
            layoutParams = new ViewGroup.LayoutParams(-1, -2);
        }
        int ॱ = azb.ॱ(imageView.getContext());
        if (2 == eib.ʾ() || cdn.ॱॱ()) {
            layoutParams.width = -1;
            layoutParams.height = (int) (((float) ॱ) / 3.0f);
        } else {
            layoutParams.width = -1;
            layoutParams.height = (int) (((float) ॱ) / 1.5789f);
        }
        return layoutParams;
    }

    public void ॱ(int i) {
        this.ʽॱ.setRenderColor(i);
        this.ʿ.setBackgroundColor(i);
    }

    public boolean ˋ(CSSDeclaration cSSDeclaration) {
        if (((CSSImage) cSSDeclaration.getPropertyValue(CSSPropertyName.BACKGROUND_IMAGE)) == null) {
            ʼ();
            return false;
        }
        if (this.ʽॱ != null) {
            this.ʽॱ.setLayoutParams(ˏ(this.ʽॱ));
        }
        return true;
    }

    public void ʼ() {
        if (this.ʽॱ == null) {
            return;
        }
        if (TextUtils.isEmpty(this.ॱͺ)) {
            ViewGroup.LayoutParams layoutParams = this.ʽॱ.getLayoutParams();
            if (layoutParams == null) {
                layoutParams = new ViewGroup.LayoutParams(-1, -2);
            }
            layoutParams.height = this.ʽॱ.getContext().getResources().getDimensionPixelSize(d.ʼᐝ) + epv.ˋ(this.ʽॱ.getContext());
            this.ʽॱ.setLayoutParams(layoutParams);
            return;
        }
        ˎ(this.ॱͺ);
    }

    public void ʽ() {
        if (this.ʽॱ != null) {
            this.ʽॱ.setLayoutParams(ˏ(this.ʽॱ));
        }
    }

    private void ᐝ(DetailHeadBean detailHeadBean) {
        if (detailHeadBean != null) {
            if (detailHeadBean.ٴ() != 2 && detailHeadBean.ٴ() != 3 && detailHeadBean.ٴ() != 1) {
                this.ˎˏ.setVisibility(8);
            } else if (TextUtils.isEmpty(detailHeadBean.ߴ())) {
                this.ˎˏ.setVisibility(8);
            } else {
                this.ˎˏ.setVisibility(0);
                if (TextUtils.isEmpty(detailHeadBean.ՙ())) {
                    this.ˍ.setVisibility(8);
                } else {
                    this.ˍ.setVisibility(0);
                    eqx.ˎ(this.ˍ, detailHeadBean.ՙ());
                }
                this.ˋᐝ.setText(detailHeadBean.ߴ());
                if (detailHeadBean.ٴ() != 3 || (this.ـ && !ᐝॱ())) {
                    this.ˋˋ.setVisibility(8);
                } else {
                    this.ˋˋ.setVisibility(0);
                }
            }
        }
    }

    private void ˎ(String str) {
        ViewGroup.LayoutParams layoutParams = this.ʽॱ.getLayoutParams();
        if (layoutParams == null) {
            layoutParams = new ViewGroup.LayoutParams(-1, -2);
        }
        layoutParams.height = (int) (((float) azb.ॱ(this.ʽॱ.getContext())) / 1.7777778f);
        layoutParams.width = -1;
        this.ʽॱ.setLayoutParams(layoutParams);
        eqx.ˎ(this.ʽॱ, str, "iconflag", this, true);
    }

    public void ॱ(final Bitmap bitmap) {
        if (bitmap != null) {
            new Handler().post(new Runnable(this) {
                final /* synthetic */ DetailHeadCard ॱ;

                public void run() {
                    try {
                        final int ˎ = erq.ˎ(bitmap);
                        this.ॱ.ʽॱ.post(new Runnable(this) {
                            final /* synthetic */ AnonymousClass4 ˊ;

                            public void run() {
                                this.ˊ.ॱ.ʽॱ.setRenderColor(ˎ);
                            }
                        });
                        CustomActionBar.ˎ(this.ॱ.ʽॱ.getContext(), ˎ, this.ॱ.ʽॱ.getHeight());
                    } catch (IllegalStateException e) {
                        Logger.e("DetailHeadCard", e.toString());
                    }
                }
            });
        }
    }

    public void ˏ(Context context, SafeIntent safeIntent) {
        if (bwz.ˎ.equals(safeIntent.getAction())) {
            Section section = (Section) safeIntent.getSerializableExtra("section");
            if (section != null && this.ॱʽ != null && this.ॱʽ.ᐝॱ() == section.ˊ()) {
                ˎ(section.ᐝ());
            }
        }
    }

    private void ˎ(int i) {
        Logger.ˎ("DetailHeadCard", "updateFollowBtn :" + i);
        DetailFollowSectionButton ʻ = ʻ();
        if (ʻ == null) {
            Logger.e("DetailHeadCard", "detailFollowBtn == null");
        } else if (i == 1) {
            ʻ.setVisibility(0);
            ʻ.ॱ(true);
        } else if (i == 0) {
            ʻ.setVisibility(0);
            ʻ.ॱ(false);
        } else {
            ʻ.setVisibility(8);
        }
    }

    public void ॱ(boolean z) {
        DetailFollowSectionButton ʻ = ʻ();
        if (ʻ != null) {
            ʻ.setImmersion(z);
        }
        if (this.ॱʽ != null) {
            ˎ(this.ॱʽ.ॱˎ());
        }
    }

    public void ॱ() {
        super.ॱ();
        ॱˊ();
    }

    private void ॱˊ() {
        DetailFollowSectionButton ʻ = ʻ();
        if (ʻ != null) {
            ʻ.setMaxWidth(epv.ˊ(fis.ˎ()) / 3);
        }
    }

    public void ˊ() {
        super.ˊ();
        ͺ();
    }

    private void ˊॱ() {
        Context context = this.ˋˋ.getContext();
        if (context instanceof Activity) {
            this.ـ = 5 == dgm.ˎ((Activity) context);
            if (this.ـ) {
                ccq.ˎ("DetailHeadCard", this);
            }
        }
    }

    private void ͺ() {
        if (this.ـ) {
            ccq.ˏ("DetailHeadCard");
        }
    }

    private boolean ᐝॱ() {
        return "CN".equals(eqp.ˋ());
    }

    public void onAccountBusinessResult(ccp o_ccp) {
        if (ᐝॱ()) {
            this.ˋˋ.setVisibility(0);
        } else {
            this.ˋˋ.setVisibility(8);
        }
    }
}
